package com.thread;

public class FinalThread {
    private int nums;
    FinalThread(){
        nums = 100;
    }
    public synchronized Boolean addNums(){
        if(nums > 10) {
            nums--;
            System.out.println(Thread.currentThread().getName() + "送出一份");
            return true;
        }
        return false;
    }
    public int getNums(){
        return nums;
    }
}
